home *** CD-ROM | disk | FTP | other *** search
/ Singles Flirt Up Your Life! (German) / Singles Flirt Up Your Life.iso / data1.cab / Statemachine / questTrouble8a.lua < prev    next >
Text File  |  2004-01-29  |  2KB  |  62 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questTrouble8a entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- on game over: relationship conditions get reset to 0 and all quests are reset to initial
  10.     onMsg("questreset", function(msg)
  11.         setState("initial");
  12.     end ) 
  13. ---------------------------------------------------------------------------------------------------------------------------------------    
  14.     
  15.     state("initial") 
  16.         onMsg("checkCondition", function(msg)
  17.             local mike = getParent().getParent().getCharacter(MIKE);
  18.             local elaine = getParent().getParent().getCharacter(ELAINE);
  19.  
  20.             if ( elaine.getRelationshipCondition(MIKE, REL_TROUBLE) >= 8 )
  21.             then
  22.                 -- go to talk position
  23.                 
  24.                 elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questTrouble8a");
  25.                 setState("talktome");
  26.             end
  27.         end )
  28.         
  29.         
  30.     state("talktome")
  31.         -- assoon as arrived - start dialog
  32.         ----------------        
  33.         onMsg("talking", function(msg)
  34.             if (msg.data == "questTrouble8a") then
  35.                 popupConversation("dialogTrouble8a");
  36.                 setState("donetalktome");
  37.             end 
  38.         ----------------
  39.         end )
  40.     
  41.     state("donetalktome");
  42.         onMsg("yes", function(msg)
  43.             getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
  44.             getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
  45.             setState("done");
  46.         end )
  47.         
  48. ---------------------------------------------------------------------------------------------------------------------------------------    
  49.  
  50.         
  51.     state("done")
  52.     
  53.     -- sackgasse hier
  54.         
  55.         
  56.         
  57. endStateMachine()
  58.  
  59.  
  60.  
  61.  
  62.